package data.nanjing.expo.models.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import data.nanjing.expo.common.DateTimeUtil;

import java.util.Date;

/**
 * Created by zjp on 2018/6/24.
 * QQ：34948062
 * github: https://www.github.com/zjp1029
 * web： http://www.zjp1029.cn
 * 对单信息表
 * 对应表: trade_order
 */
public class TradeOrder {

    private Integer id;

    private String orderNo; //订单号

    private String orderStatus;  //订单状态:unconfirmed:待确认;confirmed:已确认;paid:资金已托管;finish:服务完成;
    //accomplish:订单完成;canceling:申请取消;canceled:订单已取消

    private Integer payStatus;

    private String payWay;

    private Integer userId; //订单需方(发起人)

    private Integer supplyId;   //供方

    private String orderType;   //订单类型:如交易中心的订单

    private Integer goodsId;

    private Integer goodsPrice; //价格

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date updateTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date payTime;   //支付时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date finishTime;   //订单完成时间


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getPayWay() {
        return payWay;
    }

    public void setPayWay(String payWay) {
        this.payWay = payWay;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getSupplyId() {
        return supplyId;
    }

    public void setSupplyId(Integer supplyId) {
        this.supplyId = supplyId;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(Integer goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public String getCreateTime() {
        return DateTimeUtil.dateFormat(createTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return DateTimeUtil.dateFormat(updateTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getPayTime() {
        return DateTimeUtil.dateFormat(payTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getFinishTime() {
        return DateTimeUtil.dateFormat(finishTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    @Override
    public String toString() {
        return "TradeOrder{" +
                "id=" + id +
                ", orderNo='" + orderNo + '\'' +
                ", orderStatus='" + orderStatus + '\'' +
                ", payStatus=" + payStatus +
                ", payWay='" + payWay + '\'' +
                ", userId=" + userId +
                ", supplyId=" + supplyId +
                ", orderType='" + orderType + '\'' +
                ", goodsId=" + goodsId +
                ", goodsPrice=" + goodsPrice +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", payTime=" + payTime +
                ", finishTime=" + finishTime +
                '}';
    }
}
